import { Injectable } from '@nestjs/common';
import { News } from './interfaces/news.interface';

@Injectable()
export class NewsService {
    private readonly newsList: News[] = [];
    // 返回所有新闻列表
    getNewsPageList(): News[] {
        return this.newsList;
    }
    // 创建新闻
    createNews(news: News): News {
        this.newsList.push(news);
        return news;
    }


}
